package com.example.qianjun.gobang01.bean;

import android.graphics.Point;

import java.security.PublicKey;

/**
 * Created by qianjun on 2016/5/1.
 */
public class Constant {
    public static final int WHITE_PIECE = 1;
    public static final int BLACK_PIECE = 2;
    public static final int NO_PIECES = 0;


    //胜负状态：白棋胜利、黑棋胜利、平局
    public static final int WHITE_WINNER = 0x10;
    public static final int BLACK_WINNER = 0x11;
    public static final int NO_WINNER = 0x12;


    //当前状态：未分胜负
    public static final int NO_VICTORY_OR_DEFEAT = 0xff;

    //棋盘
    public static final int SMALL_CHECKBOARD_X = 10;
    public static final int SMALL_CHECKBOARD_Y = 10;

    public static final int MIDDDLE_CHECKBOARD_X = 15;
    public static final int MIDEDLE_CHECKBOARD_Y = 15;

    public static final int LARGE_CHECKBOARD_X = 18;
    public static final int LARGE_CHECKBOARD_Y = 18;

    //倒计时初始化
    public static final int COUNT_DOWN_NUMBER_15 = 15;
    public static final int COUNT_DOWN_NUMBER_20 = 20;
    public static final int COUNT_DOWN_NUMBER_25 = 25;
    public static final int COUNT_DOWN_NUMBER_30 = 30;
    public static final int COUNT_DOWN_NUMBER_40 = 40;
    public static final int COUNT_DOWN_NUMBER_50 = 50;
    public static final int COUNT_DOWN_NUMBER_100 = 100;
    //--------------------------------------------------------------------------------

    //选择执黑执白，下棋顺序
    public static final int CHOSE_BLACK_FIRST = 0x120;
    public static final int CHOSE_WHITE_SECOND = 0X121;
    public static final int CHOSE_WHITE_FIRST = 0X122;
    public static final int CHOSE_BLACK_SECOND = 0x123;

    //--------------------------------------------------------------------------------
    //落子提示框的外形
    //方形
    public static final int PIECE_NOTICE_STYLE_RECT = 0x111;
    //圆形
    public static final int PIECE_NOTICE_STYLE_CYCLE = 0x112;

    //悔棋存储中，没有棋子的时候的默认棋子
    public static final Point NO_POINT = new Point(0xff, 0xff);


    //--------------------------------------------------------------------------------
    //棋的种类
    public static final int FIVE_PIECES_WIN = 5;
    public static final int SIX_PIECES_WIN = 6;
    //--------------------------------------------------------------------------------
    //人人模式
    public static final int HUMAN_PK_HUMAN = 0x20;
    //人机模式
    public static final int HUMAN_PK_ROBOT = 0x21;

    //机器人水平
    public static final int ROBOT_LEVEL_STUPID = 0x100;
    public static final int ROBOT_LEVEL_FIRST = 0x101;
    public static final int ROBOT_LEVEL_SECOND = 0x102;
    public static final int ROBOT_LEVEL_THIRD = 0x103;
    public static final int ROBOT_LEVEL_FOURTH = 0x104;
    //--------------------------------------------------------------------------------
    //SmartLevelFirst棋子局势估值评分表
    public final static int FIRTS_LEVEL_FIVE_PIECE = 50000;
    public final static int FIRTS_LEVEL_LIVE_FOUR_PIECE = 20000;
    public final static int FIRTS_LEVEL_FOUR_PIECE = 12000;
    public final static int FIRTS_LEVEL_FOUR_PIECE_DEAD = 5000;
    public final static int FIRTS_LEVEL_LIVE_THREE_PIECE = 10000;
    public final static int FIRTS_LEVEL_THREE_PIECE = 5000;
    public final static int FIRTS_LEVEL_THREE_PIECE_DEAD = 2000;
    public final static int FIRTS_LEVEL_LIVE_TWO_PIECE = 3000;
    public final static int FIRTS_LEVEL_TWO_PIECE = 1800;
    public final static int FIRTS_LEVEL_TWO_PIECE_DEAD = 1000;
    public final static int FIRTS_LEVEL_LIVE_ONE_PIECE = 1200;
    public final static int FIRTS_LEVEL_ONE_PIECE = 800;
    public final static int FIRTS_LEVEL_ONE_PIECE_DEAD = 300;
    public final static int FIRTS_LEVEL_DEAD = 10;
//--------------------------------------------------------------------------------

    //棋盘位置评分 10*10
    public static final int[][] SMALL_TABLE_POSITION_SCORE = new int[][]{
            {0,0,0,0,0,0,0,0,0,0},
            {0,1,1,1,1,1,1,1,1,0},
            {0,1,2,2,2,2,2,2,1,0},
            {0,1,2,3,3,3,3,2,1,0},
            {0,1,2,3,4,4,3,2,1,0},
            {0,1,2,3,4,4,3,2,1,0},
            {0,1,2,3,3,3,3,2,1,0},
            {0,1,2,2,2,2,2,2,1,0},
            {0,1,1,1,1,1,1,1,1,0},
            {0,0,0,0,0,0,0,0,0,0}
    };

    //棋盘位置评分 15*15
    public static final int[][] MIDDLE_TABLE_POSITION_SCORE = new int[][]{
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,1,1,1,1,1,1,1,1,1,1,1,1,1,0},
            {0,1,2,2,2,2,2,2,2,2,2,2,2,1,0},
            {0,1,2,3,3,3,3,3,3,3,3,3,2,1,0},
            {0,1,2,3,4,4,4,4,4,4,4,3,2,1,0},
            {0,1,2,3,4,5,5,5,5,5,4,3,2,1,0},
            {0,1,2,3,4,5,6,6,6,5,4,3,2,1,0},
            {0,1,2,3,4,5,6,7,6,5,4,3,2,1,0},
            {0,1,2,3,4,5,6,6,6,5,4,3,2,1,0},
            {0,1,2,3,4,5,5,5,5,5,4,3,2,1,0},
            {0,1,2,3,4,4,4,4,4,4,4,3,2,1,0},
            {0,1,2,3,3,3,3,3,3,3,3,3,2,1,0},
            {0,1,2,2,2,2,2,2,2,2,2,2,2,1,0},
            {0,1,1,1,1,1,1,1,1,1,1,1,1,1,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    };


    //棋盘位置评分 18*18
    public static final int[][] LARGE_TABLE_POSITION_SCORE = new int[][]{
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0},
            {0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0},
            {0,1,2,3,3,3,3,3,3,3,3,3,3,3,3,2,1,0},
            {0,1,2,3,4,4,4,4,4,4,4,4,4,4,3,2,1,0},
            {0,1,2,3,4,5,5,5,5,5,5,5,5,4,3,2,1,0},
            {0,1,2,3,4,5,6,6,6,6,6,6,5,4,3,2,1,0},
            {0,1,2,3,4,5,6,7,7,7,7,6,5,4,3,2,1,0},
            {0,1,2,3,4,5,6,7,8,8,7,6,5,4,3,2,1,0},
            {0,1,2,3,4,5,6,7,8,8,7,6,5,4,3,2,1,0},
            {0,1,2,3,4,5,6,7,7,7,7,6,5,4,3,2,1,0},
            {0,1,2,3,4,5,6,6,6,6,6,6,5,4,3,2,1,0},
            {0,1,2,3,4,5,5,5,5,5,5,5,5,4,3,2,1,0},
            {0,1,2,3,4,4,4,4,4,4,4,4,4,4,3,2,1,0},
            {0,1,2,3,3,3,3,3,3,3,3,3,3,3,3,2,1,0},
            {0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0},
            {0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
    };

//--------------------------------------------------------------------------------

    //评分表
    public static ChessStyleFive[] chessStyleFives = new ChessStyleFive[]{

            new ChessStyleFive("0111110",3000000),
            new ChessStyleFive("011111",2900000),
            new ChessStyleFive("111110",2900000),
            new ChessStyleFive("11111",2900000),
    //------------------------------------------------------------------------------------------
            new ChessStyleFive("011110",600000),
            new ChessStyleFive("01111",300000),
            new ChessStyleFive("11110",300000),
            new ChessStyleFive("00011011000",100000),
            new ChessStyleFive("00111010000",100000),
            new ChessStyleFive("00001011100",100000),
            new ChessStyleFive("00011011",70000),
            new ChessStyleFive("11011000",70000),
            new ChessStyleFive("111010000",70000),
            new ChessStyleFive("0011101",60000),
            new ChessStyleFive("1011100",60000),
            new ChessStyleFive("000010111",60000),
            new ChessStyleFive("11101",36500),
            new ChessStyleFive("11011",36500),
            new ChessStyleFive("10111",36500),
    //------------------------------------------------------------------------------------------
            new ChessStyleFive("0011100",30000),
            new ChessStyleFive("001110",26000),
            new ChessStyleFive("011100",26000),
            new ChessStyleFive("00011010000",18000),
            new ChessStyleFive("00001011000",18000),
            new ChessStyleFive("11010000",15000),
            new ChessStyleFive("0001101",15000),
            new ChessStyleFive("1011000",15000),
            new ChessStyleFive("00001011",15000),
            new ChessStyleFive("01110",10000),
            new ChessStyleFive("11100",10000),
            new ChessStyleFive("00111",10000),
            new ChessStyleFive("01011",8000),
            new ChessStyleFive("10110",8000),
            new ChessStyleFive("01101",8000),
            new ChessStyleFive("11010",8000),
    //------------------------------------------------------------------------------------------
            new ChessStyleFive("00011000",5000),
            new ChessStyleFive("0001100",4500),
            new ChessStyleFive("0011000",4500),
            new ChessStyleFive("000110",3000),
            new ChessStyleFive("001100",3000),
            new ChessStyleFive("011000",3000),
            new ChessStyleFive("00011",1500),
            new ChessStyleFive("00110",1500),
            new ChessStyleFive("01100",1500),
            new ChessStyleFive("11000",1500)

    };

    public static void chessStyleInit() {

        //棋子的棋型得分（包括将要落子的点）
        //从上到下，得分依次降低，优先级依次降低
        chessStyleFives[0] = new ChessStyleFive("0111110",3000000);
        chessStyleFives[1] = new ChessStyleFive("011111",2900000);
        chessStyleFives[2] = new ChessStyleFive("111110",2900000);
        chessStyleFives[3] = new ChessStyleFive("11111",2900000);
        //------------------------------------------------------------------------------------------
        chessStyleFives[4] = new ChessStyleFive("011110",600000);

        chessStyleFives[5] = new ChessStyleFive("01111",300000);
        chessStyleFives[6] = new ChessStyleFive("11110",300000);

        chessStyleFives[7] = new ChessStyleFive("00011011000",100000);
        chessStyleFives[8] = new ChessStyleFive("00111010000",100000);
        chessStyleFives[9] = new ChessStyleFive("00001011100",100000);
        chessStyleFives[10] = new ChessStyleFive("00011011",70000);
        chessStyleFives[11] = new ChessStyleFive("11011000",70000);
        chessStyleFives[12] = new ChessStyleFive("111010000",70000);
        chessStyleFives[13] = new ChessStyleFive("0011101",60000);
        chessStyleFives[14] = new ChessStyleFive("1011100",60000);
        chessStyleFives[15] = new ChessStyleFive("000010111",60000);

        chessStyleFives[16] = new ChessStyleFive("11101",36500);
        chessStyleFives[17] = new ChessStyleFive("11011",36500);
        chessStyleFives[18] = new ChessStyleFive("10111",36500);
        //------------------------------------------------------------------------------------------
        chessStyleFives[19] = new ChessStyleFive("0011100",30000);
        chessStyleFives[20] = new ChessStyleFive("001110",26000);
        chessStyleFives[21] = new ChessStyleFive("011100",26000);
        chessStyleFives[22] = new ChessStyleFive("00011010000",18000);
        chessStyleFives[23] = new ChessStyleFive("00001011000",18000);
        chessStyleFives[24] = new ChessStyleFive("11010000",15000);
        chessStyleFives[25] = new ChessStyleFive("0001101",15000);
        chessStyleFives[26] = new ChessStyleFive("1011000",15000);
        chessStyleFives[27] = new ChessStyleFive("00001011",15000);
        chessStyleFives[28] = new ChessStyleFive("01110",10000);
        chessStyleFives[29] = new ChessStyleFive("11100",10000);
        chessStyleFives[30] = new ChessStyleFive("00111",10000);
        chessStyleFives[31] = new ChessStyleFive("01011",8000);
        chessStyleFives[32] = new ChessStyleFive("10110",8000);
        chessStyleFives[33] = new ChessStyleFive("01101",8000);
        chessStyleFives[34] = new ChessStyleFive("11010",8000);
        //------------------------------------------------------------------------------------------
        chessStyleFives[35] = new ChessStyleFive("00011000",5000);
        chessStyleFives[36] = new ChessStyleFive("0001100",4500);
        chessStyleFives[37] = new ChessStyleFive("0011000",4500);
        chessStyleFives[38] = new ChessStyleFive("000110",3000);
        chessStyleFives[39] = new ChessStyleFive("001100",3000);
        chessStyleFives[40] = new ChessStyleFive("011000",3000);
        chessStyleFives[41] = new ChessStyleFive("00011",1500);
        chessStyleFives[42] = new ChessStyleFive("00110",1500);
        chessStyleFives[43] = new ChessStyleFive("01100",1500);
        chessStyleFives[44] = new ChessStyleFive("11000",1500);



    }
}